<template>
  <div>
    <el-table :data="tableData" style="width: 100%" border>
      <el-table-column prop="name" label="姓名" width="150"></el-table-column>
      <el-table-column label="输入框" width="200">
        <template v-slot="scope">
          <el-input
            v-model="scope.row.inputValue"
            placeholder="请输入内容"></el-input>
        </template>
      </el-table-column>
    </el-table>
    <button @click="getAllInputValues">获取所有输入框的值</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { name: "张三", inputValue: "" },
        { name: "李四", inputValue: "" },
        { name: "王五", inputValue: "" },
      ],
    };
  },
  methods: {
    getAllInputValues() {
      const values = this.tableData.map((row) => row.inputValue);
      console.log("所有输入框的值:", values);
    },
  },
};
</script>
